﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-12-12
Description:Qudao_Log三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class Qudao_LogService
	{
		 
	 
			
		public static int DeleteQudao_LogById(int id)	
		{     
            Qudao_Log qudao_Log = new Qudao_Log();
            qudao_Log.Id = id;
            EntityQuery<Qudao_Log> query = new EntityQuery<Qudao_Log>(qudao_Log);
             return query.Delete(qudao_Log);
		}	
        
          //以标识列获得对象
        public static Qudao_Log GetQudao_LogById(int  id)
        {
            Qudao_Log qudao_Log = new Qudao_Log();
            qudao_Log.Id = id;
            EntityQuery<Qudao_Log> query = new EntityQuery<Qudao_Log>(qudao_Log);
            query.FillEntity(qudao_Log);
            return qudao_Log;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateQudao_Log(Qudao_Log qudao_Log)
        {
            Qudao_Log _qudao_Log = new Qudao_Log();

            EntityQuery<Qudao_Log> query = new EntityQuery<Qudao_Log>(_qudao_Log);
           _qudao_Log= qudao_Log;
           int i=(qudao_Log.Id==0)?
                 query.Insert(_qudao_Log): query.Update(_qudao_Log);
            return i;
        }
		
		 
	}
}

